﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace b7.Models
{
    public class Member
    {
        [Key]
        public int MemberId { get; set; }
        public string Role { get; set; }
        [Display(Name = "ten cua hang/ten dang nhap")]
        [Required(ErrorMessage = "chua nhap ten dang nhap")]
        public string UserName { get; set; }

        [Display(Name = "ten chu cua hang")]
        [Required(ErrorMessage = "chua nhap ten chu cua hang")]
        public string FullName { get; set; }

        [Display(Name = "Email")]
        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",
            ErrorMessage = "Email is is not valid.")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        [Display(Name = "mat khau dang nhap")]
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "chua nhap mat khau")]
        public string Password { get; set; }

        [DisplayFormat(DataFormatString = "{0:HH:mm-dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        [Required(ErrorMessage = "chua nhap ngay sinh")]
        public DateTime Ngaysinh { get; set; }

        [Display(Name = "Gioi tinh")]
        [Required(ErrorMessage = "chua nhap gioi tinh")]
        public string Sex { get; set; }

        [Display(Name = "CMTND")]
        [Required(ErrorMessage = "chua nhap chung minh thu nhan dan")]
        public string CMTND { get; set; }

        [Display(Name = "Dia chi")]
        [Required(ErrorMessage = "chua nhap dia chi")]
        public string Adress { get; set; }

        [Display(Name = "Điện thoại")]
        public string PhoneNumber { get; set; }

        public virtual List<BaiViet> BaiViets { get; set; }
        public virtual List<Sanpham> Sanphams { get; set; }
        //public virtual List<Orders> Orderss { get; set; }
    }
}